import { IBiz } from './biz'
import { IQueryParams } from './queryParams'
import { Currency } from './common'

export interface IDeposit extends IBiz {
  /**
   * 操作编号
   */
  operationID: string
  /**
   * 操作时间
   */
  createdAt: string
  /**
   * 操作类型
   */
  depositType: EDepositType
  /**
   * 目标金额
   */
  depositAmt: number
  /**
   * 已收取金额
   */
  currDepositAmt?: number
  /**
   * 日收取率
   */
  singlePercent?: number
  /**
   * 清算币种
   */
  depositCurr: string
  /**
   * 保证金状态
   */
  status: EDepositStatus
  /**
   * 备注
   */
  remark?: string
  /**
   * 收取记录
   */
  logs?: IDepositLog[]

  /**
   * 门店总金额
   */
  totalAmt?: number
}

export interface IDepositLog {
  /**
   * 清算日期
   */
  settDate: string,
  /**
   * 当日清算金额
   */
  settAmt: number
  /**
   * 实际收取金额
   */
  depositAmt: number
  /**
   * 剩余金额
   */
  remainAmt: number
}

export interface IDepositQuery extends IQueryParams, IBiz {
  createdAtFrom?: string
  createdAtTo?: string
  targetAmtFrom?: number
  targetAmtTo?: number
  currency?: string
  depositType?: EDepositType
  status?: EDepositStatus
}

export enum EDepositType {
  Collection = 0,
  Return,
}

export enum EDepositStatus {
  Processing = 0,
  Finish,
  Abort,
}

export interface IDepositCollection extends IBiz {
  intStoreCode?: string,
  depositAmt?: number,
  depositCurr?: string,
  depositCurrAll?: Currency, // 币种的全部信息
  singlePercent?: number,
  remark?: string,
  totalAmt?: number,
}
